<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #div1{
            width: 500px;
            height: 500px;
            border: 1px solid #000;
        }
        ul{
            margin: 0;
            padding: 0;
        }
        li{
            list-style: none;
            padding: 4px;
            border-bottom: 1px dashed #000000;
            opacity: 0;
        }
    </style>
</head>
<body>
<input type="text" id="txt" value=""/>
<button id="btn">发布</button>
<div id="div1">
    <ul>
        <li>123</li>
    </ul>
</div>
<script src="js/util.js" type="text/javascript"></script>
<script>
   var oTxt = document.getElementById('txt');
   var oBtn = document.getElementById('btn');
   var oDiv = document.getElementById('div1');
   var oUl = oDiv.getElementsByTagName('ul')[0];


   oBtn.onclick = function () {
       var content = oTxt.value;
       oTxt.value = '';

       var oLi = document.createElement('li');
       oLi.innerHTML = content;

       if(oUl.children.length>0){
           oUl.insertBefore(oLi,oUl.children[0]);

       }
       else {
           oUl.appendChild(oLi);
       }

       var iHeight = oLi.offsetHeight;
       startMove(oLi,{height:iHeight},function () {
           startMove(oLi,{opacity:100})
       });


   }



</script>
</body>
</html>